using System;
using CILADA.TestAssemblyThree;

namespace CILADA.TestAssembly
{
    public class Dog : Animal, IPet, IFavouriteToy
    {
        public string PetName { get { return PetName; } set { PetName = value; } }

        public Toys FavToy
        {
            get { return FavToy; }
            set { FavToy = value; }
        }

        private Owner owner { get { return owner; } set { owner = value; } }

        public Dog(string petName, Toys favToy)
        {
            this.PetName = petName;
            this.FavToy = favToy;
            this.SpeciesName = "Dog";
            this.owner = new Owner("Some Person");
        }

        public override void Eat()
        {
            Console.WriteLine(PetName + " (a " + this.SpeciesName + ") is eating...");
        }

        public override void Sleep()
        {
            Console.WriteLine(PetName + " (a " + this.SpeciesName + ") is sleeping on " + this.owner.GetName() + "'s chair...");
        }

        public void Play()
        {
            Console.WriteLine(PetName + " (a " + this.SpeciesName + ") is playing with a " + this.FavToy + "...");
        }

        public void BarkAtOwner()
        {
            Console.WriteLine(PetName + " (a " + this.SpeciesName + ") barks at " + this.owner.GetName());
        }

        private class Owner
        {
            private OwnerName _name;

            public Owner(string name)
            {
                _name = new OwnerName(name);
            }

            public string GetName()
            {
                return _name.NameValue;
            }

            private class OwnerName {
                public string NameValue
                {
                    get;
                    set;
                }

                public OwnerName(string name)
                {
                    this.NameValue = name;
                }
            }
        }
    }
}
